var e, t = (e = require("@vant/weapp/toast/toast")) && e.__esModule ? e : {
    default: e
};

var o = require("../../utils/api"), a = require("../../utils/request"), s = require("../../utils/config");

Page({
    data: {
        themeColor: getApp().globalData.themeColor,
        imageUrl: s.resourceRoot + "pay_success.png",
        orderNo: ""
    },
    onLoad: function(e) {
        console.log("支付成功跳转", e), this.setData({
            orderNo: e.orderNo
        });
    },
    paySuccess: function(e) {
        var s = this;
        a.request(a.HttpMethod.POST, o.apiRoute.paySuccessFilmPrint, {
            orderNo: e
        }).then(function(e) {
            s.setData({
                submitLoading: !1
            }), e.success ? console.log("更新胶片订单状态成功") : (0, t.default)({
                message: e.message,
                duration: 5e3
            });
        }).catch(function(e) {
            s.setData({
                submitLoading: !1
            }), console.log(e), (0, t.default)({
                message: "更新订单状态异常",
                duration: 5e3
            });
        });
    },
    finish: function() {
        wx.switchTab({
            url: "/pages/index/index"
        });
    },
    invoice: function() {
        a.request(a.HttpMethod.GET, o.apiRoute.getInvoiceUrl + this.data.orderNo, {}).then(function(e) {
            "20000" == e.code ? wx.navigateTo({
                url: "/pages/webview/webview?h5=".concat(encodeURIComponent(e.data)),
                success: function() {}
            }) : (0, t.default)({
                message: e.message,
                duration: 5e3
            });
        }).catch(function(e) {
            console.log(e), (0, t.default)({
                message: "获取开票链接异常",
                duration: 5e3
            });
        });
    }
});